using System;
using System.Collections.Generic;
using System.Text;

namespace Zsa.Emulation.Render.Video
{
    /// <summary>
    /// Settings for drawing colors on the pixels.
    /// </summary>
    public struct ColorPixelFormat
    {
        /// <summary>
        /// Creates a 32bit argb.
        /// </summary>
        /// <returns></returns>
        public static ColorPixelFormat Create32BitARGB()
        {
            return new ColorPixelFormat(4, 3, 2, 1, 0,
                0xFF, 0xFF, 0xFF, 0xFF);
        }

        public static ColorPixelFormat Create24BitARGB()
        {
            return new ColorPixelFormat(4, 3, 2, 1, 0,
                0xFF, 0xFF, 0xFF, 0xFF);
        }

        #region Fields
        /// <summary>
        /// The pixel size.
        /// </summary>
        public readonly byte PixelSize;

        /// <summary>
        /// The alpha offset.
        /// </summary>
        public readonly byte Color_A_ByteOffset;

        /// <summary>
        /// The red offset.
        /// </summary>
        public readonly byte Color_R_ByteOffset;

        /// <summary>
        /// The green ofset.
        /// </summary>
        public readonly byte Color_G_ByteOffset;

        /// <summary>
        /// The blue offset.
        /// </summary>
        public readonly byte Color_B_ByteOffset;

        /// <summary>
        /// The alpha offset.
        /// </summary>
        public readonly byte A_Mask;

        // The mask
        public readonly byte R_Mask;

        public readonly byte G_Mask;

        public readonly byte B_Mask;
        #endregion Fields

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ColorPixelSettings"/> class.
        /// </summary>
        /// <param name="pixelSize">Size of the pixel.</param>
        /// <param name="colorAOffset">The color A offset.</param>
        /// <param name="colorROffset">The color R offset.</param>
        /// <param name="colorGOffset">The color G offset.</param>
        /// <param name="colorBOffset">The color B offset.</param>
        /// <param name="colorAMask">The color A mask.</param>
        /// <param name="colorRMask">The color R mask.</param>
        /// <param name="colorGMask">The color G mask.</param>
        /// <param name="colorBMask">The color B mask.</param>
        public ColorPixelFormat(byte pixelSize, byte colorAOffset,
            byte colorROffset, byte colorGOffset, byte colorBOffset,
            byte colorAMask, byte colorRMask, byte colorGMask, byte colorBMask)
        {
            PixelSize = pixelSize;
            Color_A_ByteOffset = colorAOffset;
            Color_R_ByteOffset = colorROffset;
            Color_G_ByteOffset = colorGOffset;
            Color_B_ByteOffset = colorBOffset;

            A_Mask = colorAMask;
            R_Mask = colorRMask;
            G_Mask = colorGMask;
            B_Mask = colorBMask;

        }
    }
}
